package Service;

/**
 * @author cyye
 *
 */
public class Variable {

	public final static int INTEGER = 0;
	public final static int FLOAT = 1;
	public final static int STRING = 2;
	public final static int BOOLEAN = 3;
	public final static int OTHERS = 4;
	public static final int DOUBLE = 5;
	
	private String name;
	private int type;
	private Object value;
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getName() {
		return name;
	}

	public void setType(int type) {
		this.type = type;
	}

	public int getType() {
		return type;
	}

	public void setValue(Object value) {
		this.value = value;
	}

	public Object getValue() {
		return value;
	}
	
	public Variable cloneVariable() {
		Variable variable = new Variable();
		variable.setName(name);
		variable.setType(type);
		variable.setValue(variable);
		return variable;
	}

	public static boolean validType(int type) {
		// TODO Auto-generated method stub
		switch(type){
		case INTEGER:
		case FLOAT:
		case STRING:
		case BOOLEAN:
		case OTHERS:
		case DOUBLE:	
			return true;
		default:
				return false;
		}		
	}
	
	
}